﻿using System;
using System.Collections.Generic;
using WBFSe.IO;

namespace WBFSe.Data
{
    /// <summary>
    /// Links a filename with the respective file
    /// </summary>
    class NamePointer : IComparer<NamePointer>
    {
        // Variables

        public String Name;
        public IWbfsFileInfo File;

        // Methods

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="name">Filename</param>
        /// <param name="file">File</param>
        public NamePointer(String name, IWbfsFileInfo file)
        {
            this.Name = name;
            this.File = file;
        }

        /// <summary>
        /// Compares 2 NamePointers
        /// </summary>
        /// <param name="x">NamePointer</param>
        /// <param name="y">NamePointer</param>
        /// <returns>Name comparison</returns>
        public int Compare(NamePointer x, NamePointer y)
        {
            return x.Name.CompareTo(y.Name);
        }
    }
}
